#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>

using namespace std;

typedef long long int64;

const double eps = 1e-7;
const double pi = 3.1415926535897932384626433832795;

struct point_t
{
	double x, y;
	point_t() : x(0), y(0) {}
	point_t(double a, double b) : x(a), y(b) {}
};

struct circle_t
{
	point_t cent;
	double r;
};

struct data_t
{
	circle_t circle;
	int color;
	data_t() {};
};

struct arc_t
{
	arc_t() : area(-1) {}
	double x0, y0, x1, y1;
	data_t *ref;
	int position;
	double area;
	double compute_area();
	double get_area() const;
};

double dist(const point_t &a, const point_t &b)
{
	return hypot(a.x - b.x, a.y - b.y);
}

void rotate(point_t &p, double a)
{
	p = point_t(p.x * cos(a) - p.y * sin(a), p.x * sin(a) + p.y * cos(a));
}

point_t operator+(const point_t&p, const point_t&q)
{
	return point_t(p.x + q.x, p.y + q.y);
}

point_t operator-(const point_t&p, const point_t&q)
{
	return point_t(p.x - q.x, p.y - q.y);
}

point_t operator*(const point_t&p, double k)
{
	return point_t(p.x * k, p.y * k);
}

point_t operator/(const point_t&p, double k)
{
	return point_t(p.x / k, p.y / k);
}

inline void compute(const circle_t &a, double x0, double &lower, double &upper)
{
	double x1 = x0 - a.cent.x;
//	printf("(%.2lf, %.2lf), x = %.2lf\n", a.cent.x, a.cent.y, x0);
	double delta = sqrt(a.r * a.r - x1 * x1 + 1e-10);

	lower = a.cent.y - delta;
	upper = a.cent.y + delta;
//	if (hypot(x0 - a.cent.x, upper - a.cent.y) > 1e-5) cout << "!!!" << hypot(x0 - a.cent.x, upper - a.cent.y) << endl;
}

bool operator<(const arc_t &a, const arc_t &b)
{
	if (a.y0 < b.y0 - eps || a.y1 < b.y1 - eps) return true;
	if (b.y0 < a.y0 - eps || b.y1 < a.y1 - eps) return false;
	if (a.position > 0 && b.position < 0) return true;
	if (a.position < 0 && b.position > 0) return false;
	if (a.position > 0)
		return a.get_area() > b.get_area();
	else
		return a.get_area() < b.get_area();
}

int n;
data_t data[500];
arc_t arc[1000];

double arc_t::get_area() const
{
	return area;
}

double arc_t::compute_area() 
{
//	if (area >= -eps) return area;
	circle_t &a = ref->circle;
	double alpha1 = atan2(x0 - a.cent.x, y0 - a.cent.y);
	double alpha2 = atan2(x1 - a.cent.x, y1 - a.cent.y);
	double alpha = abs(alpha1 - alpha2);
	while (alpha > pi) alpha = alpha - pi;
	while (alpha < 0) alpha = alpha + pi;
	if (alpha > pi / 2) alpha = pi - alpha;

	double d = hypot(x0 - x1, y0 - y1) / 2;

	area = a.r * a.r * alpha / 2 - d * sqrt(a.r * a.r - d * d + eps);
	return area;
}

istream& operator>>(istream& is, circle_t &c)
{
	is >> c.cent.x >> c.cent.y >> c.r;
}

int	main()
{
	int T;
	cin >> T;

	while (T--)
	{
		int R, G, B;
		cin >> R >> G >> B;
		int n = 0;
		for (int i = 0; i < R; ++i) cin >> data[n].circle, data[n].color = 1, ++n;
		for (int i = 0; i < G; ++i) cin >> data[n].circle, data[n].color = 2, ++n;
		for (int i = 0; i < B; ++i) cin >> data[n].circle, data[n].color = 3, ++n;

		vector<double> position;
		for (int i = 0; i < n; ++i)
		{
			circle_t &a = data[i].circle;
			position.push_back(a.cent.x + a.r);
			position.push_back(a.cent.x - a.r);
			for (int j = i + 1; j < n; ++j)
			{
				circle_t &a = data[i].circle;
				circle_t &b = data[j].circle;

				double d = dist(a.cent, b.cent);
				if (d < abs(a.r - b.r) - eps || d > a.r + b.r + eps)
					continue;

				point_t hor_dir = (b.cent - a.cent) / d;
				point_t ver_dir = hor_dir;
				rotate(ver_dir, pi / 2);
				double cosA = (a.r * a.r + d * d - b.r * b.r) / 2 / a.r / d;
				double mid = a.r * cosA;
				double h = sqrt(a.r * a.r - mid * mid);

				point_t p1 = a.cent + hor_dir * mid + ver_dir * h;
				point_t p2 = a.cent + hor_dir * mid - ver_dir * h;
				position.push_back(p1.x);
				position.push_back(p2.x);
//				printf("(%.2lf, %.2lf) with (%.2lf, %.2lf) inter in (%.2lf, %.2lf) and (%.2lf, %.2lf)\n", 
//					a.cent.x, a.cent.y, b.cent.x, b.cent.y, p1.x, p1.y, p2.x, p2.y);
			}
		}
		sort(position.begin(), position.end());

		double total_area[10];
		for (int i = 0; i < 10; ++i) total_area[i] = 0;

		for (int pos = 1; pos < position.size(); ++pos)
		{
			if (position[pos] - position[pos - 1] < eps) continue;
			double x0 = position[pos - 1];
			double x1 = position[pos];
//			printf("x = %.2lf - %.2lf\n", x0, x1);

			int m = 0;

			for (int i = 0; i < n; ++i)
			{
				circle_t &a = data[i].circle;
				if (x0 < a.cent.x + a.r && x1 > a.cent.x - a.r)
				{
					compute(a, x0, arc[m].y0, arc[m + 1].y0);
					compute(a, x1, arc[m].y1, arc[m + 1].y1);
					arc[m].x0 = arc[m + 1].x0 = x0;
					arc[m].x1 = arc[m + 1].x1 = x1;
					arc[m].ref = arc[m + 1].ref = data + i;
					arc[m].position = 1;		//	upper
					arc[m + 1].position = -1;	//	lower
					arc[m].compute_area();
					arc[m + 1].compute_area();
					m += 2;
				}
			}

			sort(arc, arc + m);

			if (0)
			for (int i = 0; i < m; ++i)
			{
//				cout << arc[i].ref->circle.cent.x << ' ' << arc[i].ref->circle.cent.y << endl;
				printf("y0 = %.2lf, y1 = %.2lf ", arc[i].y0, arc[i].y1);
				printf("cent = (%.2lf, %.2lf), position = %d\n", 
					arc[i].ref->circle.cent.x, arc[i].ref->circle.cent.y, arc[i].position);
			}

			int count[4];
			memset(count, 0, sizeof(count));
			for (int i = 0; i < m; ++i)
			{
				if (count[0] > 0)
				{
					int cover_color = 0;
					if (count[1] > 0) cover_color += 1;
					if (count[2] > 0) cover_color += 2;
					if (count[3] > 0) cover_color += 4;

					double temp = (x1 - x0) * (arc[i].y0 + arc[i].y1 - arc[i - 1].y0 - arc[i - 1].y1) / 2;

					if (arc[i - 1].position > 0)
						temp += arc[i - 1].get_area();
					else
						temp -= arc[i - 1].get_area();

					if (arc[i].position < 0)
						temp += arc[i].get_area();
					else
						temp -= arc[i].get_area();
//					cout << cover_color << ' ' << temp << ' ' << arc[i - 1].get_area() << ' ' << arc[i].get_area() << endl;
					total_area[cover_color] += temp;
				}

				if (arc[i].position > 0)
				{
					++ count[arc[i].ref->color];
					++ count[0];
				} else
				{
					-- count[arc[i].ref->color];
					-- count[0];
				} 
			}
		}

		for (int i = 0; i < 8; ++i) if (total_area[i] < eps) total_area[i] = 0;
		printf("%.2lf ",  total_area[1]); 
		printf("%.2lf ",  total_area[2]); 
		printf("%.2lf ",  total_area[4]); 
		printf("%.2lf ",  total_area[7]); 
		printf("%.2lf ",  total_area[3]); 
		printf("%.2lf ",  total_area[5]); 
		printf("%.2lf ",  total_area[6]); 
		
		printf("\n");
	}
	return 0;
}
